//对象的深拷贝
let obj1 ={
    a:'1',
    b:'2'
}
let obj2 = {
    a:'1',
    obj:{
        a:"2"
    }
}
function cloneDeep(newobj={},originObj){
    for(let key in originObj){
        if(originObj[key] && originObj[key] instanceof object){
            newobj[key] = cloneDeep(originObj[key])
        }else{
            newobj[key] = originObj[key]
        }
    }
    return newobj
}
cloneDeep(obj1)

console.log(newobj)